//
//  Register ViewController.m
//  豆瓣
//
//  Created by dllo on 15/12/8.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "RegisterViewController.h"
#import "RegisterView.h"

@interface RegisterViewController ()<RegisterViewDelegate>
@property (retain, nonatomic) RegisterView *myRegView;


@end

@implementation RegisterViewController

- (void)dealloc{
    [_myRegView release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.myRegView = [[RegisterView alloc] initWithFrame:self.view.bounds];
//    self.view.frame = self.myRegView.frame;
    self.myRegView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:_myRegView];
    [_myRegView release];
    
    
    
    
    
    UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
    [self.view addGestureRecognizer:tapGR];
    [tapGR release];
    self.myRegView.myDelegate = self;
    
    NSUserDefaults *userD = [NSUserDefaults standardUserDefaults];
    NSString *str = [userD objectForKey:@"account"];
    NSLog(@"%@", str);

    
}

//- (void)saveDataToLocation{
//    
//    
//}


- (void)popToUserView{
    [self.navigationController popViewControllerAnimated:YES];
    [self.myDelegate dismissToUserView];

}

- (void)dismissToLoginView{
    
    [self dismissViewControllerAnimated:YES completion:^{
        
        
    }];
    
}


- (void)tapAction:(UITapGestureRecognizer *)tap{
    [self.myRegView.codePrint resignFirstResponder];
    [self.myRegView.accountPrint resignFirstResponder];
    [self.myRegView.isCodePrint resignFirstResponder];
    [self.myRegView.telePrint resignFirstResponder];
    [self.myRegView.mailPrint resignFirstResponder];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
